<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div></div>
  </body>
  <script>
    // 引入SDK核心类，js文件根据自己业务，位置可自行放置
    var QQMapWX = require("../../libs/qqmap-wx-jssdk.js");
    var qqmapsdk;
    Page({
      onLoad: function () {
        // 实例化API核心类
        qqmapsdk = new QQMapWX({
          key: "CFQBZ-OCI3W-4HERJ-YGNTE-4JLM5-OJBY7",
        });
      },
      onShow: function () {
        // 调用接口
        qqmapsdk.search({
          keyword: "酒店",
          success: function (res) {
            console.log(res);
          },
          fail: function (res) {
            console.log(res);
          },
          complete: function (res) {
            console.log(res);
          },
        });
      },
    });
  </script>
</html>
